import { MockMethod } from "vite-plugin-mock";

export default [
  {
    url: "/api/v1/orders/page",
    method: "get",
    response: () => {
      return {
        code: "00000",
        data: {
          list: [
            {
              id: 1,
              code: "000001",
              name: "李沧区融创门店1",
              mId: 1,
              mName: "李四",
              uId: 1,
              uName: "王五",
              amount: 50000,
              operationId: 1,
              statusFlag: 0,
              status: "待上传",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
            {
              id: 2,
              code: "000002",
              name: "李沧区融创门店2",
              mId: 1,
              mName: "李四2",
              uId: 1,
              uName: "王五2",
              amount: 50000,
              operationId: 1,
              statusFlag: 2,
              status: "待放款",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
            {
              id: 3,
              code: "000003",
              name: "李沧区融创门店3",
              mId: 1,
              mName: "李四3",
              uId: 1,
              uName: "王五3",
              amount: 50000,
              operationId: 1,
              statusFlag: 5,
              status: "订单成功",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
            {
              id: 4,
              code: "000004",
              name: "李沧区融创门店4",
              mId: 1,
              mName: "李四4",
              uId: 1,
              uName: "王五4",
              amount: 50000,
              operationId: 1,
              statusFlag: 0,
              status: "待上传",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
            {
              id: 5,
              code: "000005",
              name: "李沧区融创门店5",
              mId: 1,
              mName: "李四5",
              uId: 1,
              uName: "王五5",
              amount: 50000,
              operationId: 1,
              statusFlag: 0,
              status: "待上传",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
            {
              id: 6,
              code: "000006",
              name: "李沧区融创门店6",
              mId: 1,
              mName: "李四6",
              uId: 1,
              uName: "王五6",
              amount: 50000,
              operationId: 1,
              statusFlag: 0,
              status: "待上传",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
            {
              id: 7,
              code: "000007",
              name: "李沧区融创门店7",
              mId: 1,
              mName: "李四7",
              uId: 1,
              uName: "王五7",
              amount: 50000,
              operationId: 1,
              statusFlag: 1,
              status: "待审核",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
            {
              id: 8,
              code: "000008",
              name: "李沧区融创门店8",
              mId: 1,
              mName: "李四8",
              uId: 1,
              uName: "王五8",
              amount: 50000,
              operationId: 1,
              statusFlag: 2,
              status: "待放款",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
            {
              id: 9,
              code: "000009",
              name: "李沧区融创门店9",
              mId: 1,
              mName: "李四9",
              uId: 1,
              uName: "王五9",
              amount: 50000,
              operationId: 1,
              statusFlag: 3,
              status: "待结算",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
            {
              id: 10,
              code: "000010",
              name: "李沧区融创门店10",
              mId: 1,
              mName: "李四10",
              uId: 1,
              uName: "王五10",
              amount: 50000,
              operationId: 1,
              statusFlag: 4,
              status: "申请撤销",
              operatorId: 3,
              operator: "王李可",
              createTime: "2021-03-25 12:39:54",
              updateTime: null,
            },
          ],
          total: 11,
        },
        msg: "一切ok",
      };
    },
  },
  {
    //数据汇总
    url: "/api/v1/orders/data_summarization",
    method: "get",
    response: () => {
      return {
        code: "00000",
        data: {
          myRanking: 12,
          rankingRake: 30,
          approvedOrder: 14,
          approvedOrderRate: 56,
          orderSuccess: 50,
          orderSuccessRate: 80,
          failedOrder: 2,
          failedOrderRate: 10,
          expectedOrder: 20,
          expectedOrderRate: 40,
          loanAmount: 232343,
          loanAmountRate: 100,
          totalOrder: 222,
          totalOrderRate: 66,
        },
        msg: "一切ok",
      };
    },
  },
  {
    //待处理订单
    url: "/api/v1/orders/pending_order",
    method: "get",
    response: () => {
      return {
        code: "00000",
        data: [
          {
            //待审核订单
            count: 56,
            amount: 50000001,
          },
          {
            //待上传订单
            count: 66,
            amount: 50000002,
          },
          {
            //待放款订单
            count: 76,
            amount: 50000003,
          },
          {
            //待结算订单
            count: 86,
            amount: 50000004,
          },
          {
            //申请撤销订单
            count: 96,
            amount: 50000005,
          },
          {
            //待审核订单
            count: 36,
            amount: 50000006,
          },
        ],
        msg: "一切ok",
      };
    },
  },
  {
    //逾期情况
    url: "/api/v1/orders/overdue_situation",
    method: "get",
    response: () => {
      return {
        code: "00000",
        data: {
          sumConsumption: 5643135,
          sumConsumptionRate: 30,
          orderQty: 14,
          orderQtyRate: 56,
          badRate: 3,
          overdueAmount: [130, 343, 221, 454, 232],
        },
        msg: "一切ok",
      };
    },
  },
  {
    url: "/api/v1/orders/:id/form",
    method: "get",
    response: ({ url }) => {
      // const id = url.match(/\/api\/v1\/users\/(\d+)\/form/)[1];
      let formData = {
        id: 1,
        code: "000001",
        name: "李沧区融创门店1",
        mId: 1,
        mName: "李四",
        uId: 1,
        uName: "王五",
        amount: 50000,
        statusFlag: 0,
        status: "待上传",
        operatorId: 3,
        createTime: "2021-03-25 12:39:54",
        updateTime: null,
      };

      return {
        code: "00000",
        data: formData,
        msg: "一切ok",
      };
    },
  },
] as MockMethod[];
